home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Internet Tools 1993 July / Internet Tools.iso / RockRidge / info-service / gopher / Rice_CMS / gopher24 / gopclist.$rexx < prev    next >
Encoding:
Text File  |  1993-01-25  |  7.2 KB  |  92 lines

  1. /*                                                                      00010000
  2.  *        Name: GOPCLIST REXX                                           00020000
  3.  *              VM TCP/IP Network GOPHER Client transaction status      00030000
  4.  *      Author: Rick Troth, Rice University, Information Systems        00040000
  5.  *        Date: 1993-Jan-12                                             00050000
  6.  *                                                                      00060000
  7.  *       Input: zero or more connection status messages                 00070000
  8.  *      Output: -none-                                                  00080000
  9.  */                                                                     00090000
  10.                                                                         00100000
  11. /*                                                                      00110000
  12.  *      Copyright 1992 Richard M. Troth.   This software was developed  00120000
  13.  *      with resources provided by Rice University and is intended      00130000
  14.  *      to serve Rice's user community.   Rice has benefitted greatly   00140000
  15.  *      from the free distribution of software,  therefore distribution 00150000
  16.  *      of unmodified copies of this material is not restricted.        00160000
  17.  *      You may change your own copy as needed.   Neither Rice          00170000
  18.  *      University nor any of its employees or students shall be held   00180000
  19.  *      liable for damages resulting from the use of this software.     00190000
  20.  */                                                                     00200000
  21.                                                                         00210000
  22. Trace "OFF"                                                             00220000
  23.                                                                         00230000
  24. /*  sync with input  */                                                 00240000
  25. 'PEEKTO'                                                                00250000
  26. If rc ^= 0 Then Exit rc * (rc ^= 12)                                    00260000
  27.                                                                         00270000
  28. /*  abort if we're not in a 370 mode machine  */                        00280000
  29. Parse Value Diag(08,'QUERY SET') With . "MACHINE" mach . ',' . '15'x .  00290000
  30. If mach ^= "370" & mach ^= "" Then Do                                   00300000
  31.     'CALLPIPE *: | HOLE'                                                00310000
  32.     Exit rc                                                             00320000
  33.     End  /*  If  ..  Do  */                                             00330000
  34.                                                                         00340000
  35. /*  fetch fs. stem variable from GlobalVs  */                           00350000
  36. 'CALLPIPE COMMAND GLOBALV SELECT GOPHER LIST | DROP' ,                  00360000
  37.         '| LOCATE 1-4 / FS./ | SPEC /=/ 1 2-* NEXT | VARLOAD'           00370000
  38. If ^Datatype(fs.tube,'X') Then fs.tube = ""                             00380000
  39.                                                                         00390000
  40. /*  prepare for dynamic connection statistics  */                       00400000
  41. _wid = fs.scrcols - 2                                                   00410000
  42. _sba = c2x(sba(1,-1) || '1D60'x)                                        00420000
  43.                                                                         00430000
  44. 'CALLPIPE *: | CHOP ' _wid '| PAD' _wid ,                               00440000
  45.        '| SPEC /00C3' || _sba || '/ X2C 1 1-* NEXT' ,                   00450000
  46.        '| FULLSCR' fs.tube 'NOREAD | HOLE'                              00460000
  47.                                                                         00470000
  48. Exit rc                                                                 00480000
  49.                                                                         00490000
  50.                                                                         00500000
  51.                                                                         00510000
  52. /* ----------------------------------------------------------------- SBA00520000
  53.  *  (a better SBA function extracted from PIPEDEMO; thanks, Chuck!)     00530000
  54.  *  Construct Set Buffer Address order from row and column.             00540000
  55.  */                                                                     00550000
  56.                                                                         00560000
  57. SBA:      Procedure Expose fs.                                          00570000
  58.                                                                         00580000
  59. arg row , col, .                                                        00590000
  60. row = Trunc(row)                                                        00600000
  61. col = Trunc(col)                                                        00610000
  62.                                                                         00620000
  63. /*-----------------------------------------------------------------*/   00630000
  64. /* Calculate binary address.                                       */   00640000
  65. /*-----------------------------------------------------------------*/   00650000
  66.                                                                         00660000
  67. offset = row * fs.scrcols + col                                         00670000
  68. Do While offset < 0; offset = offset + fs.scrrows * fs.scrcols; End     00680000
  69.                                                                         00690000
  70. if fs.14bit then return '11'x || d2c(offset,2)                          00700000
  71.                                                                         00710000
  72. /*-----------------------------------------------------------------*/   00720000
  73. /* Convert to six-bit format. (xxxx111111111111 -> 0011111100111111*/   00730000
  74. /*-----------------------------------------------------------------*/   00740000
  75.                                                                         00750000
  76. 'CALLPIPE var offset'               ,   /* Start with char number.    */00760000
  77.     '| spec 1-* d2c 1.2 right'      ,   /* Convert to binary.         */00770000
  78.     '| spec 1-* c2b 1'              ,   /* Convert to bit string.     */00780000
  79.     '| spec /00/ 1  5.6  3'         ,   /* Place first six bits.      */00790000
  80.            '/00/ 9 11.6 11'         ,   /* Place second six bits.     */00800000
  81.     '| spec 1-* b2c 1'              ,   /* Convert back to binary.    */00810000
  82.     '| xlate *-* 00-3F 40-7F'       ,   /* Translate to coded         */00820000
  83.                 '01-09 C1-C9'       ,   /*   buffer address.          */00830000
  84.                 '11-19 D1-D9'       ,   /*                            */00840000
  85.                 '22-29 E2-E9'       ,   /*                            */00850000
  86.                 '30-39 F0-F9'       ,   /*                            */00860000
  87.     '| spec x11 1 1.2 2'            ,   /* Prefix with SBA order.     */00870000
  88.     '| var offset'                      /* Put back in variable.      */00880000
  89.                                                                         00890000
  90. Return offset                                                           00900000
  91.                                                                         00910000
  92.